package com.htl.exampro.question.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 试题表
 * </p>
 *
 * @author hehehe
 * @since 2025-05-25
 */
@Data
@TableName("question")
public class QuestionDO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    public static final String QUESTION_ID = "question_id";
    public static final String TYPE_ID = "type_id";
    public static final String CONTENT = "content";
    public static final String OPTIONS = "options";
    public static final String CORRECT_ANSWER = "correct_answer";
    public static final String IS_PUBLIC = "is_public";
    public static final String Y_QUESTION_ID = "y_question_id";
    public static final String VERSION = "version";
    public static final String IS_CURRENT = "is_current";
    public static final String CREATED_PERSON = "created_person";
    public static final String CREATED_TIME = "created_time";
    public static final String UPDATED_PERSON = "updated_person";
    public static final String UPDATED_TIME = "updated_time";
    public static final String IS_DELETED = "is_deleted";

    /**
     * 试题ID
     */
    @TableId(value = "question_id", type = IdType.ASSIGN_ID)
    private Long questionId;

    /**
     * 题型
     */
    @TableField("type_id")
    private Integer typeId;

    /**
     * 试题内容
     */
    @TableField("content")
    private String content;

    /**
     * 选择题选项
     */
    @TableField("options")
    private String options;

    /**
     * 正确答案
     */
    @TableField("answer")
    private String answer;
    /**
     * 解析
     */
    @TableField("analysis")
    private String analysis;

    /**
     * 难度
     */
    @TableField("difficulty")
    private Integer difficulty;

    /**
     * 是否公开(0私有/1公开)
     */
    @TableField("is_public")
    private Boolean isPublic;

    /**
     * 原试题ID
     */
    @TableField("y_question_id")
    private Long yQuestionId;

    /**
     * 试题版本
     */
    @TableField("version")
    private Integer version;

    /**
     * 最新版本(1最新版/0非最新版)
     */
    @TableField("is_current")
    private Boolean isCurrent;

    /**
     * 创建人ID
     */
    @TableField(value = "created_person", fill = FieldFill.INSERT)
    private String createdPerson;

    /**
     * 创建时间
     */
    @TableField("created_time")
    private LocalDateTime createdTime;

    /**
     * 修改人ID
     */
    @TableField(value = "updated_person", fill = FieldFill.UPDATE)
    private String updatedPerson;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    private LocalDateTime updatedTime;

    /**
     * 逻辑删除标志 0-未删除 1-已删除
     */
    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted;
}
